<!DOCTYPE html>
<html>
<head>

<style>
  #touchElement {
    width: 20px;
    height: 20px;
  }
</style>

</head>
<body>

<p id="description">
This tests checks that deferred compositing is still invoked when nothing except touch hit rects change.
The trickiness is that touch hit rects cannot be recomputed until after compositing is updated, so
there is a risk of accidentally skipping updating touch rects unless we ping the compositor correctly.
</p>

<div id="touchElement"></div>

<pre id="result"></pre>

<script>

  function dummyListener() { }

  if (window.testRunner)
    testRunner.dumpAsText();

  if (window.internals) {
    internals.forceCompositingUpdate(document);
    document.getElementById("touchElement").addEventListener("touchmove", dummyListener, false);
    internals.forceCompositingUpdate(document);

    var rects = internals.touchEventTargetLayerRects(document);
    if (rects && rects.length == 1)
      document.getElementById("result").innerHTML = "PASS";
    else
      document.getElementById("result").innerHTML = "FAIL";

  } else {
      document.getElementById("result").innerHTML = "This test can only be run as a layout test.";
  }

</script>
</body>
